<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php $this->load->view('head'); ?>
</head>

<body>
	<?php $this->load->view('header_admin.php'); ?>
	
	<!-- Content Area -->
	<div class="wrapper-world content">
		<div class="wrapper">
			<h1>Terms and Conditions</h1>
			
			<?php echo form_open_multipart('terms/upload', 'class="left-aligned" id="tacForm"'); ?>
				<div class="one">
					<label for="filename">Name:</label>
					<div class="type-text"><input type="text" name="filename" id="filename" /></div>
					<div class="clr"></div>
				</div>
				<div class="one">
					<label>Select a file:</label>
					<div class="file-upload"> 
					    <input type="file" name="userfile" size="24" id="BrowserHidden" onchange="getElementById('FileField').value = getElementById('BrowserHidden').value;" />			 
					    <div id="BrowserVisible"><input type="text" id="FileField" /></div>
					</div>
					<div class="clr"></div>
				</div>		
			</form>
		</div>
		
		<div class="wrapper-world add-btn">
			<div class="wrapper">
				<a href="javascript:jQuery('form#tacForm').submit();" title="Add this tac">ADD</a>
				<div class="clr"></div>
			</div>
		</div>	
		
		<div class="job-listing">
			<?php $c = 0; foreach ($docs as $doc): ?>
			<div class="wrapper-world job-<?php echo (($c%2 == 0) ? "odd" : "even");?>">
				<div class="wrapper">
					<?php if ($doc->ext == "doc"): ?>
					<div class="file-type type-doc">MS Word file</div>
					<?php elseif ($doc->ext == "img"): ?>
					<div class="file-type type-img">BMP Image file</div>
					<?php elseif ($doc->ext == "txt"): ?>
					<div class="file-type type-txt">Text file</div>
					<?php elseif ($doc->ext == "xls"): ?>
					<div class="file-type type-xls">MS Excel file</div>
					<?php elseif ($doc->ext == "pdf"): ?>
					<div class="file-type type-pdf">Adobe Reader file</div>
					<?php else: ?>
					<div class="file-type type-other">Other type</div>
					<?php endif; ?>
					<div class="job-details"><a href="" target="_blank"><?php echo anchor('/uploads/docs/'.$doc->file, htmlspecialchars($doc->name)); ?></a></div>
					<div class="job-delete"><?php echo anchor('terms/delete/'.$doc->id, 'Delete'); ?></div>
					<div class="clr"></div>
				</div>
			</div>
			<?php $c++; endforeach; ?>
		</div>
		
	</div> <!-- end of wrapper-world and .content -->
		
	<div class="wrapper-world footer-top">
		<div class="wrapper"></div>	
	</div>
	
	<?php $this->load->view('footer'); ?>
</body>
</html>
